package br.com.SGF.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name="cadastro_macroservico")
@NamedQueries({
	@NamedQuery(name = "Macro.listar", query = "SELECT macro FROM MacroServicoDomain macro")})
public class MacroServicoDomain {
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="cdo_id")
	private int codigo;
	
	@Column(name="cdo_nome", length=50)
	private String nome;
	
	@Column(name="cdo_descricao", length=50)
	private String descricao;
	
	@Column(name = "cdo_inativo", columnDefinition = "tinyint default false")
	private boolean inativo;
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "cdo_cds_id", referencedColumnName = "cds_id")
	private ServicoDomain servico;

	public int getCodigo() {
		return codigo;
	}

	public void setCodigo(int codigo) {
		this.codigo = codigo;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public boolean isInativo() {
		return inativo;
	}

	public void setInativo(boolean inativo) {
		this.inativo = inativo;
	}

	public ServicoDomain getServico() {
		return servico;
	}

	public void setServico(ServicoDomain servico) {
		this.servico = servico;
	}

	
	
}
